package com.qfedu.rocketmq01.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/11/13 11:49
 * @Modified:
 */
@Component
@RocketMQMessageListener(topic = "xingmq01",consumerGroup = "xingconsumer") //标记 需要监听 对应主题的消息
@Slf4j
public class MqMsgListener2 implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        log.info("RocketMQ消费端2-接收消息={}，当前时间={}",s,System.currentTimeMillis());
        //消息处理
    }
}
